import request from '@/router/axios';

export const getList = (current, size, params) => {
    return request({
        url: '/api/mes-product/smttable/page',
        method: 'get',
        params: {
            ...params,
            current,
            size
        }
    });
};

export const getDetail = (params) => {
    return request({
        url: '/api/mes-product/smttable/track/page',
        method: 'get',
        params: params
    });
};

export const getLog = (id) => {
    return request({
        url: '/api/mes-product/smttable/detail/all',
        method: 'get',
        params: {
            id
        }
    });
};

export const update = (data) => {
    return request({
        url: '/api/mes-product/smttable/tableAndTrack/submit',
        method: 'post',
        data: data
    });
};

export const remove = (ids) => {
    return request({
        url: '/api/mes-product/smttable/remove',
        method: 'post',
        params: {
            ids
        }
    });
};

export const enable = (id) => {
    return request({
        url: '/api/mes-product/smttable/enable',
        method: 'get',
        params: {
            id
        }
    });
};

export const disable = (id) => {
    return request({
        url: '/api/mes-product/smttable/disable',
        method: 'get',
        params: {
            id
        }
    });
};

export const importCheck = (data) => {
    return request({
        url: '/api/mes-product/smttable/mechineNonMachineSticker/check',
        method: 'post',
        data: data
    });
};

export const importSubmit = (data) => {
    return request({
        url: '/api/mes-product/smttable/mechineNonMachineSticker/import',
        method: 'post',
        data: data,
        headers: {
            'Content-Type': 'multipart/form-data'
        }
    });
};
